package Day08.Demo02;

/**
 * @author HYHwtx
 * @version 1.0
 * @date 2022/2/12 17:49
 */
public class Demo01StringEquals {
    public static void main(String[] args) {
        String str1 = "Hello";
        String str2 = "Hello";
        char[] charArray = {'H','e','l','l','o'};
        String str3 = new String(charArray);

        System.out.println(str1.equals(str2));
        System.out.println(str2.equals(str3));
        System.out.println(str3.equals("Hello"));
        System.out.println("Hello".equals(str1));

        String str4 = "hello";
        System.out.println(str1.equals(str4));

        String str5 = "abc";
        System.out.println("abc".equals(str5));
        System.out.println(str5.equals("abc"));


        System.out.println("==================");
        String strA = "Java";
        String strB = "java";
        System.out.println(strA.equals(strB));//false，区分大小写
        System.out.println(strA.equalsIgnoreCase(strB));//true。忽略大小写


        //注意：只有英文字母区分大小写，其他的都不区分
        System.out.println("abc一123".equalsIgnoreCase("abc壹123"));
    }
}
